<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" src="../static/easyui/jquery.min.js"></script>
<script type="text/javascript" src="../static/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript" src="../static/easyui/locale/easyui-lang-zh_CN.js"></script>
<link rel="stylesheet" href="../static/easyui/themes/icon.css">
<link rel="stylesheet" href="../static/easyui/themes/metro-orange/easyui.css">
<style type="text/css">

     
</style>
</head>
<body>
<script type="text/javascript">
	$(function(){
		//初始化表格
		$('#chubushbiao').datagrid({
		    url:'chubuyuan',
		    columns:[[
				/* {field:'RSEID',width:1,title:'简历编号',align:'center'}, */
				{field:'RSENAME',width:1,title:'姓名',align:'center'},
				{field:'RFSNAME',width:1,title:'学历',align:'center'},
				{field:'RSEJS',width:1,title:'技术',align:'center'},
				{field:'POTZW',width:1,title:'应聘职位',align:'center'},
				{field:'DEMQLD',width:1,title:'操作',align:'center',
					formatter:function(value,row,index){
		                if(value==""){
		                    return "<input type='button'onclick='tgcbshenhe()' value='通过' class='an_haocolor an_tongugole'>\
					        <input type='button'onclick='btgcbshenhe()' value='不通过'class='an_haocolor an_butongguola'>";
		                }else if(value=="1"){
		                	return "<input type='button' onclick='qukaoshi()' value='已通过，去考试'class='an_haocolor an_kaoshiqulou'>"
		                }else if(value=="2"){
		                	return "<span>不合格</span>"
		                }else if(value="3"){
		                	return "<span>安排考试中</span>"
		                }else{
		                	return "错误"
		                }
					}
				}
		    ]],
		    pagination:true,
		    pageNumber:1,
		    pageSize:10,
		    pageList:[10,20,30]
		});
	});
	
	//通过初步审核
	function tgcbshenhe(){
		var rows=$("#chubushbiao").datagrid("getChecked");
		//alert(rows[0].DEMID+"----"+rows[0].RSEID);
	     $.ajax({
			type:"post",
			url:"shenhe_rsezt",
			data:{demcbtongguo_dem:rows[0].DEMID,
				  demcbtongguo_rse:rows[0].RSEID
			},
			success:function(){
				$("#chubushbiao").datagrid();
			}
		});  
	}
	//初步审核不通过
	function btgcbshenhe(){
		var rows=$("#chubushbiao").datagrid("getChecked");
	    //alert(rows[0].DEMID+"------"+rows[0].RSEID);
		$.ajax({
			type:"post",
			url:"shenhebu_rsezt",
			data:{demcbbutongguo_dem:rows[0].DEMID,
				  demcbbutongguo_rse:rows[0].RSEID
			},
			success:function(){
				$("#chubushbiao").datagrid();
			}
		}); 
	}
	//考试
	function qukaoshi(){
		var rows=$("#chubushbiao").datagrid("getChecked");
		//alert(rows[0].DEMID+"-----"+rows[0].RSEID+"-----"+rows[0].POTID);
		//发起考试--->意向表添加数据
		 $.ajax({
			type:"post",
			url:"shenhe_qukaoshi",
			data:{qukaoshi_dem:rows[0].DEMID,
				  qukaoshi_rse:rows[0].RSEID,
				  qukaoshi_pot:rows[0].POTID
			},
			success:function(){
				$("#chubushbiao").datagrid();
			}
		}); 
		//发起考试时修改初步审核和简历状态
		$.ajax({
			type:"post",
			url:"kaoshi_zhuantai",
			data:{kaoshizt_dem:rows[0].DEMID,
				  kaoshizt_rse:rows[0].RSEID
			},
			success:function(){
				$("#chubushbiao").datagrid();
			}
		}); 
		//发起考试时添加一条笔试记录
		$.ajax({
			type:"post",
			url:"kaoshi_bishijilu",
			data:{ksbishijilu_dem:rows[0].DEMID},
			success:function(){
				$("#chubushbiao").datagrid();
			}
		}); 
	}
</script>
      <div class="chubox">
          <div class="topbox">
              <div style="margin:20px 0px 0px 10%;float:left;font-size:20px;">审核详情</div>
              <div class="anbox">
                 <!--  <div style="float:left"><input type="button" value="简历详情" onclick="adds('简历详情','oyp/recruit-jianli')"></div> -->
                 <!--  <div style="float:left"><input type="button" value="测试记录" onclick="adds('测试记录','oyp/recruit-kaoshi')"></div>
                  <div style="float:left"><input type="button" value="最终审核" onclick="adds('最终审核','oyp/recruit-zzshenhe')"></div> -->
              </div>
          </div>
          <div style="display:none;"></div>
          <div class="zhubox">
              <div class="zhujie">
	              <table id="chubushbiao" class="easyui-datagrid"
	                data-options="width:1000,fitColumns:true,height:420,singleSelect: true">
	              </table>
              </div>
         </div>
      </div>
</body>
</html>